significants = find(stat_ave.statmap>stat_ave.clusteralphamap);
clusternum = 1; clustersize = 1;
for j = 2:length(significants)
	if significants(j) == significants(j-1) + 1
		clustersize(clusternum) = clustersize(clusternum) + 1;
	else
		gapsize(clusternum) = significants(j) - significants(j-1) + 1;
		clusternum = clusternum + 1;
		clustersize(clusternum) = 1;
	end
end

pvalues = sum(stat_ave.clustermassdist>clustersize)./1000;
 
